﻿using System;
using Autofac;
using HelloWorld.Controllers;
using HelloWorld.Repositories;
using Phoenix;
using Trace = Phoenix.Diagnostics.Trace;
using TraceLevel = Phoenix.Diagnostics.TraceLevel;

namespace HelloWorld
{
    public partial class App
    {
        public App()
        {
            Trace.TraceLevel = TraceLevel.Debug;
        }

        protected override void ConfigurePhoenixHostBuilder(IPhoenixHostBuilder hostBuilder)
        {
            hostBuilder.Configuration.DefaultControllerAction = "Login.Login";
        }

        protected override void ConfigureContainer(ContainerBuilder containerBuilder)
        {
            containerBuilder.RegisterType<MenuRepository>().As<IMenuRepository>();
            containerBuilder.RegisterType<MenuTargetsController>().AsSelf();
            containerBuilder.RegisterType<MainController>().AsSelf();
            containerBuilder.RegisterType<LoginController>().AsSelf();
        }
    }
}
